import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:study_demo/ui/ffi/ffi_controller.dart';

class FFiPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetX<FFiController>(
        init: FFiController(),
        builder: (controller) {
          return Scaffold(
            appBar: AppBar(
              title: Text('flutter ffi'),
            ),
            body: Center(
                child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  controller.result.value.toString(),
                  style: TextStyle(fontSize: 17, color: Colors.redAccent),
                ),
                TextButton(
                    onPressed: () {
                      controller.cal();
                    },
                    child: Text(
                      '计算',
                      style: TextStyle(color: Colors.deepPurpleAccent),
                    ))
              ],
            )),
          );
        });
  }
}
